import os
from ament_index_python.packages import get_package_share_directory
from launch import LaunchDescription
from launch_ros.actions import Node

def generate_launch_description():
    
    config_file = os.path.join(
        get_package_share_directory('lio_sam'), # 替换 'lio_sam' 为您的包名
        'config',
        'map_preprocess_params.yaml'
    )

    return LaunchDescription([
        Node(
            package='lio_sam',
            executable='map_preprocessor_node',
            name='map_preprocessor_node',
            output='screen',
            parameters=[config_file]
        )
    ])